﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace EpiMapit
{
	public class ControlConstants
	{
        /// <summary>
        /// How many points to use when drawing a polygon that looks like a circle.
        /// </summary>
        public const int CirclePoints = 20;

		/// <summary>
		/// Controls the scale relationships between number of cases per circles and the size representation. 
		/// It's a logarithmic base, higher numbers make bigger differences between circles 
		/// </summary>
		public static float CircleScalingLogBase = 8;

        /// <summary>
        /// Minimum value for the scale relationships. User won't be able to choose a value less than this.
        /// </summary>
        public const float MinCircleScalingLogBase = 2;

        /// <summary>
        /// Maximum value for the scale relationships. User won't be able to choose a value greater than this.
        /// </summary>
        public const float MaxCircleScalingLogBase = 14;
		
		/// <summary>
		/// Controls the extent of the fade of a circle when it falls below the MinLodPixels;
		/// </summary>
		public const int LodMinFadeExtent = 10;

		/// <summary>
		/// Controls the extent of the fade of a circle when it falls above the MaxLodPixels;
		/// </summary>
		public const int LodMaxFadeExtent = 50;
		
		/// <summary>
		/// Determines which is the minimum size in pixels to show a circle.
		/// </summary>
        public const int LodMinPixels = 30;//100;

		/// <summary>
		/// Determines which is the maximum size in pixels to show a circle.
		/// </summary>
		public const int LodMaxPixels = 400;//500;

        /// <summary>
        /// How many kilometers to group in each LOD.
        /// </summary>
        public const int LodKilometers = 50;
		
		public const string CircleBorderColor = "00000000";
        public const int Alpha = 255;
		public static Color InnerRingColor = Color.FromArgb(Alpha, 0, 0, 0);
        public static Color FirstRingColor = Color.FromArgb(Alpha, 0x4b, 0x05, 0x01);
        public static Color SecondRingColor = Color.FromArgb(Alpha, 0xA9, 0x00, 0x10);
        public static Color ThirdRingColor = Color.FromArgb(Alpha, 0xE2, 0x76, 0x5F);
        public static Color[] RingColors = new Color[] { InnerRingColor, FirstRingColor, SecondRingColor, ThirdRingColor };
  
        /// <summary>
        /// Separation of the discs according to LOD.  Easy to replace with a formula 5x8^(lod-1)
        /// </summary>
        public static int[] RingAltitudeFactors;

        /// <summary>
        /// How many levels of details to have.
        /// </summary>
        public static int LodLevels;

        static ControlConstants() {
            ControlConstants.RingAltitudeFactors = new int[] { 5, 40, 320, 2500, 5000 };
            ControlConstants.LodLevels = RingAltitudeFactors.Length;
        }
        
        /// <summary>
        /// The altitude of the first (lowest)ring is this number times the corresponding LOD Altitude Factor
        /// </summary>
        public static int FirstRingAltitude = 10;

	}
}
